<?php
require ('../include/init.inc.php');
extract ( $_REQUEST );


$module = Card::getById ( $id );
if(empty($module)){
	Common::exitWithError(ErrorMessage::MODULE_NOT_EXIST,"panel/modules.php");
}

if (Common::isPost ()) {

	$input_data = array ('card_no' => $sim, 
						'card_type' => $type,
						'phone'=>$phone,
						'operator'=>$operator,
						'channel'=>$channel,
						'dead_time'=>$dead_time);

		$result = Card::updateCard ($input_data, $id);
		
		if ($result>=0) {
			SysLog::addLog ( UserSession::getUserName(), 'MODIFY', 'Module' ,$module_id, json_encode($update_data) );
			Common::exitWithSuccess ('更新完成','panel/sms.php');
		} else {
			OSAdmin::alert("error");
		}
	
}

Template::assign ( 'module', $module );
Template::assign ( 'view', $view );
Template::display ( 'panel/sms_modify.tpl' );